package org.jeecgframework.web.material.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**   
 * @Description: 配件模板-产品
 * @date 2015-08-19 09:51:44
 * @version V1.0   
 *
 */
@Entity
@Table(name = "product_template", schema = "")
@SuppressWarnings("serial")
public class ProductTemplateEntity implements java.io.Serializable {
	//主键
	private java.lang.String id;
	//产品ID
	private PProductEntity productId;
	//模板ID
	private PartTemplateEntity templateId;
	//公司ID
	private CompanyEntity companyId;
	//备注
	private java.lang.String remark;
	//保存产品的数量
	private java.lang.Integer productSum;

	@Column(name ="PRODUCT_SUM")
	public java.lang.Integer getProductSum() {
		return productSum;
	}
	public void setProductSum(java.lang.Integer productSum) {
		this.productSum = productSum;
	}
	
	
	/**
	 *get方法: 取得主键
	 */
	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name ="ID",nullable=false,length=32)
	public java.lang.String getId(){
		return this.id;
	}

	/**
	 *set方法: 设置主键
	 */
	public void setId(java.lang.String id){
		this.id = id;
	}
	/**
	 *get方法: 取得产品ID
	 */
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name ="PRODUCT_ID")
	public PProductEntity getProductId(){
		return this.productId;
	}

	/**
	 *set方法: 设置产品ID
	 */
	public void setProductId(PProductEntity productId){
		this.productId = productId;
	}
	/**
	 *get方法: 取得模板ID
	 */
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name ="TEMPLATE_ID")
	public PartTemplateEntity getTemplateId(){
		return this.templateId;
	}

	/**
	 *set方法: 设置模板ID
	 */
	public void setTemplateId(PartTemplateEntity templateId){
		this.templateId = templateId;
	}
	/**
	 *get方法: 取得公司ID
	 */
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name ="COMPANY_ID")
	public CompanyEntity getCompanyId(){
		return this.companyId;
	}

	/**
	 *set方法: 设置公司ID
	 */
	public void setCompanyId(CompanyEntity companyId){
		this.companyId = companyId;
	}
	/**
	 *get方法: 取得备注
	 */
	@Column(name ="REMARK",nullable=true,length=45)
	public java.lang.String getRemark(){
		return this.remark;
	}

	/**
	 *set方法: 设置备注
	 */
	public void setRemark(java.lang.String remark){
		this.remark = remark;
	}
	
	
}
